#-*coding:UTF-8-*-
#执行其他程序
'''
Created on 2013-6-4

@author: hanjiewu
'''
import os
os.system("dir")#通常和不会产生输出的命令一起使用

f = os.popen("dir",'r')
data = f.readline()
f.close()
print data

#window 下需要添加shell=True
from subprocess import call
res = call(('dir', r'F:\workspace\mypython'), shell=True)

print res

from subprocess import Popen,PIPE
f = Popen(('dir',r'F:\workspace\mypython'),stdout=PIPE, shell=True).stdout
data = f.readline()
print data

print os.environ
print os.times()